<?php
class model_tasks extends common_model {
	/**
	 * 基本表属性
	 */
	protected $table = 'tasks';
	protected $pk = 'task_id';

	/**
	 * 获取要执行的任务
	 */
	public function get_to_execute() {
		$time = date('H')*60 + date('i');
		$today = strtotime(date('Y-m-d'));
		
		$res = $this->find_all("time<=$time AND last_executed<$today+time AND enable=1", '', '', '*');
		
		return $res;
	}
}
?>